package com.example.xx;

import java.io.IOException;
import java.net.URL;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.ImageView;

public class FullImg extends Activity{
	TouchImageView img;
	ImageView imageView;
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.activity_fullimg);
//	        imageView = (ImageView) findViewById(R.id.imageView1);
			new DoTask().execute();
			img = (TouchImageView) findViewById(R.id.img);
//	        img.setImageResource(R.drawable.snoopy);
	        img.setMaxZoom(4f);
			
	    }
	 
	 private class DoTask extends AsyncTask<Object, Void, Void> {
			Bitmap bmp;
			
			@Override
			protected void onPreExecute() {
				
			}
			
			@Override
			protected Void doInBackground(Object... args) {
				try {
					URL url = new URL("http://xximg.googlecode.com/files/1352722556398.jpg");
					bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
				} catch (IOException e) {

				}
				return null;

			}

			@Override
			protected void onPostExecute(Void result) {
//				imageView.setImageBitmap(bmp);
				img.setImageBitmap(bmp);
				
			}
		}
}
